package ru.amse.tsyganov.jumleditor.validator;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class ProblemsContentProvider 
	implements IStructuredContentProvider {
	
	private ProblemsList problemsList;
	
	public ProblemsContentProvider(ProblemsList problemsList) {

		this.problemsList = problemsList;
	}

	public void inputChanged(Viewer v, Object oldInput, Object newInput) {
		if (newInput != null) {
			problemsList = (ProblemsList) newInput;
		}
	}

	public void dispose() {
	}

	public Object[] getElements(Object parent) {
		return problemsList.getList().toArray();
	}
}


